# Use the official Playwright Python image as a base image
FROM mcr.microsoft.com/playwright/python:v1.48.0-jammy

# Set environment variables for Lambda
ENV AWS_LAMBDA_FUNCTION_NAME my_lambda_function
ENV AWS_LAMBDA_FUNCTION_MEMORY_SIZE 10240
ENV AWS_LAMBDA_FUNCTION_TIMEOUT 900

# Install Python dependencies
RUN pip install --upgrade pip
RUN pip install awslambdaric

# Copy Lambda function code
COPY . /app
RUN pip install -r /app/requirements.txt
# Set the working directory
WORKDIR /app

# Command to run the Lambda function
CMD ["python3", "-m", "awslambdaric", "lambda_function.handler"]